//
//  CreateAccountPage.swift
//  Uber
//
//  Created by 朱 桓 on 16/1/11.
//  Copyright © 2016年 zhu.huan. All rights reserved.
//

import UIKit

class CreateAccountPage: ZhBasePage,SelectCountryPageDelegate {
    @IBOutlet weak var countryCode: UIButton!
    @IBOutlet weak var phoneNum: UITextField!

    override func viewDidLoad()
    {
        super.viewDidLoad()
        
        self.title = "创建账户"
        
        // 设置导航栏右边按钮
        setNavigationItem("下一步", selector: "doRight", isRight: true)
        // 设置导航栏左边按钮
        setNavigationItem("取消", selector: "doBack", isRight: false)
        
        // 边框圆角，设置cornerRadius的值，masksToBounds设置为true
        backgroundView.layer.masksToBounds = true
        backgroundView.layer.cornerRadius = 5

    }
    
    override func doRight()
    {
        let userInfoPage = UserInfoPage()
        self.navigationController?.pushViewController(userInfoPage, animated: true)
    }

    /**
    *选择国家
    */
    @IBAction func doSelectCountry(sender: UIButton)
    {
        let page = SelectCountryPage()
        page.delegate = self
        let navPage = UINavigationController(rootViewController: page)
        self.presentViewController(navPage, animated: true, completion: nil)
    }

    /**
    *实现代理方法
    */
    func displayCountryCode(code: String, flag: String)
    {
        ptLog(flag)
        countryCode.setImage(UIImage(named: code), forState: UIControlState.Normal)
    }
    
    override func didReceiveMemoryWarning()
    {
        super.didReceiveMemoryWarning()
    }

}
